#define _CRT_SECURE_NO_WARNINGS

#include <stdio.h>

int* findDisappearedNumbers(int* nums, int numsSize, int* returnSize) {
    int* num = (int*)calloc(numsSize * sizeof(int));
    for (int i = 0; i < numsSize; i++) {
        num[nums[i] - 1]++;
    }
    *returnSize = 0;
    for (int i = 0; i < numsSize; i++) {
        if (num[i] == 0) {
            num[*returnSize] = i + 1;
            (*returnSize)++;
        }
    }
    return num;
}

int main() {
    int nums[] = { 4,3,2,7,8,2,3,1 };
    int returnSize = 0;
    int *num = findDisappearedNumbers(nums,sizeof(nums) / sizeof(int),&returnSize);
    free(num);
	return 0;
}